package com.lyn.io.sp

import android.content.Context
import android.content.SharedPreferences

/**
 *
 * @author longyn 2025/03/01
 * @version 1.0.0
 */
interface Sp {

    fun initialize(context: Context, name: String)

    fun initialize(context: Context, name: String, defaultT: Any)

    fun initialize(sharedPreferences: SharedPreferences)

    fun initialize(sharedPreferences: SharedPreferences, defaultT: Any)

    fun getString(key: String): String

    fun getString(key: String, defaultValue: String): String

    fun setString(key: String, value: String)

    fun getInt(key: String): Int

    fun getInt(key: String, defaultValue: Int): Int

    fun setInt(key: String, value: Int)

    fun getLong(key: String): Long

    fun getLong(key: String, defaultValue: Long): Long

    fun setLong(key: String, value: Long)

    fun getFloat(key: String): Float

    fun getFloat(key: String, defaultValue: Float): Float

    fun setFloat(key: String, value: Float)

    fun getBoolean(key: String): Boolean

    fun getBoolean(key: String, defaultValue: Boolean): Boolean

    fun setBoolean(key: String, value: Boolean)

    fun clear()
}